package com.javabase.Object.ObjectMiddle.Work;

public class Work15 {
    public static void main(String[] args) {
        AAA aaa = new BBB();//向上转型，使父类引用指向子类对象
        System.out.println(aaa.getClass());//运行右边
        aaa = new CCC();//父类引用不用变
        System.out.println(aaa.getClass());
        //【多态】能结合方法的【动态绑定机制】
    }
}

class AAA {
}

class BBB extends AAA {
}

class CCC extends BBB {
}